<template>
  <div id="basic_layout">
    <a-layout style="min-height: 100vh">
      <a-layout-header class="header">
        <global-header />
      </a-layout-header>
      <a-layout>
        <global-sider
          v-if="loginUserStore.loginUser.id"
          breakpoint="lg"
          collapsed-width="0"
          class="sider"
          style="width: 200px"
        />
        <a-layout-content class="content">
          <router-view />
        </a-layout-content>
      </a-layout>
      <a-layout-footer class="footer">
        <a href="https://gitee.com/huzhenhao337/yu-picture" target="_blank">我的代码仓库</a>
      </a-layout-footer>
    </a-layout>
  </div>
</template>

<script setup lang="ts">
import GlobalSider from '@/components/GlobalSider.vue'
import GlobalHeader from '@/components/GlobalHeader.vue'
import { useLoginUserStore } from '@/stores/useUserLoginStore.ts'

const loginUserStore = useLoginUserStore()
</script>

<style lang="less" scoped>
#basic_layout {
  .header {
    padding-inline: 20px;
    margin-bottom: 1px;
    color: unset;
    background: white;
  }

  .content {
    background: linear-gradient(to right, #fefefe, #fff);
    margin-bottom: 28px;
    padding: 28px;
  }

  .sider {
    background: #ffffff;
    padding-top: 20px;
    border-right: 0.5px solid #eee;
  }

  :deep(.ant-menu-root) {
    border-bottom: none !important;
    border-inline-end: none !important;
  }

  .footer {
    background: #efefef;
    padding: 16px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
  }
}
</style>
